package com.API.dal.entities;

// Generated 03.06.2013 4:15:36 by Hibernate Tools 4.0.0

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Employees generated by hbm2java
 */
@Entity
@Table(name = "EMPLOYEES", schema = "PUBLIC", catalog = "PUBLIC")
public class Employees implements java.io.Serializable {

	private Integer id;
	private SalaryType salaryType;
	private Posts posts;
	private Date startDate;
	private String name;
	private int salary;
	private String description;
	private Set<EmployeeProject> employeeProjects = new HashSet<EmployeeProject>(
			0);
	private Set<EmployeesCosts> employeesCostses = new HashSet<EmployeesCosts>(
			0);

	public Employees() {
	}

	public Employees(SalaryType salaryType, Posts posts, Date startDate,
			String name, int salary) {
		this.salaryType = salaryType;
		this.posts = posts;
		this.startDate = startDate;
		this.name = name;
		this.salary = salary;
	}

	public Employees(SalaryType salaryType, Posts posts, Date startDate,
			String name, int salary, String description,
			Set<EmployeeProject> employeeProjects,
			Set<EmployeesCosts> employeesCostses) {
		this.salaryType = salaryType;
		this.posts = posts;
		this.startDate = startDate;
		this.name = name;
		this.salary = salary;
		this.description = description;
		this.employeeProjects = employeeProjects;
		this.employeesCostses = employeesCostses;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "ID", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "SALARY_TYPE_ID", nullable = false)
	public SalaryType getSalaryType() {
		return this.salaryType;
	}

	public void setSalaryType(SalaryType salaryType) {
		this.salaryType = salaryType;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "POST_ID", nullable = false)
	public Posts getPosts() {
		return this.posts;
	}

	public void setPosts(Posts posts) {
		this.posts = posts;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "START_DATE", nullable = false, length = 10)
	public Date getStartDate() {
		return this.startDate;
	}

	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}

	@Column(name = "NAME", nullable = false, length = 128)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "SALARY", nullable = false)
	public int getSalary() {
		return this.salary;
	}

	public void setSalary(int salary) {
		this.salary = salary;
	}

	@Column(name = "DESCRIPTION", length = 512)
	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "employees")
	public Set<EmployeeProject> getEmployeeProjects() {
		return this.employeeProjects;
	}

	public void setEmployeeProjects(Set<EmployeeProject> employeeProjects) {
		this.employeeProjects = employeeProjects;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "employees")
	public Set<EmployeesCosts> getEmployeesCostses() {
		return this.employeesCostses;
	}

	public void setEmployeesCostses(Set<EmployeesCosts> employeesCostses) {
		this.employeesCostses = employeesCostses;
	}

}
